﻿''' <summary>
''' Thrown when the file can't be found 
''' </summary>
''' <remarks></remarks>
''' <editHistory></editHistory>
Public Class ScriptLoadException
    Inherits Exception

    ''' <summary>
    ''' Creates a new instance of the ScriptLoadException class.
    ''' </summary>
    ''' <param name="script">The script that experienced problems.</param>
    ''' <param name="originalException">The original exception (becomes InnerException)</param>
    ''' <remarks></remarks>
    Friend Sub New(ByVal script As Script, _
                   ByVal originalException As Exception)

        'call the base stuff
        MyBase.New(String.Format("An occurred while attempting to get script items from script '{0}' - {1}", script.Name, originalException.Message), originalException)

        'Save the script
        _script = script

    End Sub

#Region "Properties"
    Private _script As Script

    ''' <summary>
    ''' This is the original script that caused the error
    ''' </summary>
    ''' <value></value>
    ''' <remarks></remarks>
    Public ReadOnly Property Script() As Script
        Get
            Return _script
        End Get
    End Property

#End Region

End Class
